/**
 * 
 */
package domain;

/**
 * @author grupo22
 *
 */
public class Computer extends Product {

	private String processor;
	private int memory;
	private int disc;
	private double display;
	private boolean guadalinexComp;
	
	public Computer(String brand, String model, double price, Article article,
			Supplier supplier, String processor, int memory, int disc,
			double display, boolean guadalinexComp) {
		super(brand, model, price, article, supplier);
		this.processor = processor;
		this.memory = memory;
		this.disc = disc;
		this.display = display;
		this.guadalinexComp = guadalinexComp;
	}
	
	public Computer(String brand, String model, double price, Article article,
			Supplier supplier) {
		super(brand, model, price, article, supplier);
	}

	public String getProcessor() {
		return processor;
	}

	public void setProcessor(String processor) {
		this.processor = processor;
	}

	public int getMemory() {
		return memory;
	}

	public void setMemory(int memory) {
		this.memory = memory;
	}

	public int getDisc() {
		return disc;
	}

	public void setDisc(int disc) {
		this.disc = disc;
	}

	public double getDisplay() {
		return display;
	}

	public void setDisplay(double display) {
		this.display = display;
	}

	public boolean isGuadalinexComp() {
		return guadalinexComp;
	}

	public void setGuadalinexComp(boolean guadalinexComp) {
		this.guadalinexComp = guadalinexComp;
	}

	/* (non-Javadoc)
	 * @see domain.Product#doValidate()
	 */
	public void doValidate() {
		if (memory >= 512 && disc >= 40 && guadalinexComp == true) {
			super.setValid(true);
		} else {
			super.setValid(false);
		}
		super.setValidate(true);
	}
	
	public void doContract(){
		if (this.isValid()){
			super.setContracted(true);
		}
	}

}
